# coding=utf-8
from gm.api import *
import numpy as np
import talib

set_token("90be3f863b23ab3c1ef68d1f9b8dc06e4bebb30d")

data = history_n(symbol="SZSE.399006",
                 frequency="1d",
                 count=100,
                 end_time="2017-12-31",
                 fields="close",
                 fill_missing='last',
                 adjust=ADJUST_PREV,
                 df=True
                 )
close = np.asarray(data['close'].values)
macd,signal,hist = talib.MACD(close,fastperiod=12,slowperiod=26,signalperiod=9)

macd=np.nan_to_num(macd)
print(macd)


